<template>
  <Head />
  <BgVideo />
  <div class="home">
    <div class="welcome">
      <span class="welcome-text">{{ $t("welcome") }}</span>
      <span class="brand-name">
        Z-PLAN
      </span>
    </div>

    <div class="brand-logo">
      <img src="@/assets/image/logo.png" alt="Brand Logo" />
    </div>

    <div class="maxWidthLg">
      <div class="wrapper about">
        <div class="heading">
          {{ $t("firstEcology") }}
        </div>
        <p class="paragraph">
          {{ $t("welcomeTips") }}
        </p>
      </div>

      <div class="content">
        <div class="wrapper">
          <div class="heading heading1">
            {{ $t("tokenDetails") }}
          </div>
          <div class="con">
            <div class="text">{{ $t("tokenName") }}：<span>BT2</span></div>
            <div class="text">
              {{ $t("measureDistribution") }}：<span>9.9{{ $t("million") }}</span>
            </div>
            <div class="text">
              {{ $t("lpPot") }}：<span>4.4{{ $t("million") }}</span>
            </div>
            <div class="text">
              {{ $t("ecologicalEquityPool") }}：<span>5.5{{ $t("million") }}</span>
            </div>
            <div class="text">
              {{ $t("initialValue") }}：<span>0.0000027272727/BNB</span>
            </div>
            <div class="text">
              {{ $t("singleMaximumPurchase") }}：<span>20{{ $t("tenThousand") }}BT2</span>
            </div>
            <div class="text">
              {{ $t("maximumSlippage") }}：<span>5{{ $t("tenThousand") }}BT2</span>
            </div>
            <br />
            <div class="text">
              {{ $t("tradingSlippage") }}：<span>5%</span>
              {{ $t("construction") }}
            </div>
            <div class="text">
              {{ $t("consensusNode") }}：<span>30%</span>（{{
                $t("addressHolding")
              }}）
            </div>
            <div class="text">
              {{ $t("marketValueMarketing") }}：<span>30%</span>（{{
                $t("globalPublicity")
              }}）
            </div>
            <div class="text">
              {{ $t("airdropRecommendation") }}：<span>20%</span>（{{
                $t("relationship")
              }}）
            </div>
            <div class="text">
              {{ $t("blackHoleDestruction") }}：<span>20%</span>（{{
                $t("deflation")
              }}）
            </div>
            <br />
            {{ $t("tradingDeflation") }} <span>5%</span>，{{
              $t("tradingDeflation1")
            }}
            <br />
          </div>
        </div>
      </div>

      <div class="content">
        <div class="wrapper">
          <div class="heading">
            BT2{{ $t("contractAddress") }}
          </div>
          <div class="container">
            <div type="text" class="card-input" :value="address" :disabled="true">
              {{ address }}
            </div>
            <div class="copy" @click="onCopy()" >{{$t('copy')}}</div>
            <!-- <img src="@/assets/image/copy.svg"/> -->
          </div>
        </div>
      </div>
    </div>
    <Footer />
  </div>
</template>

<script setup lang="ts">
import { showToast } from "vant";
import { useI18n } from "vue-i18n";
import clipboard3 from "vue-clipboard3";
const { toClipboard } = clipboard3();
const video = ref(null);
onMounted(() => {
  if (video.value) {
    video.value.play(); // 手动播放视频
  }
});
const address = "0x9F90C5cd1418c4D2Ab733d7335498149C5b14169"
const { t } = useI18n();
const onCopy = async () => {
  await toClipboard(address);
  showToast(t("copySuccess"));
};
</script>
<style scoped lang="scss">
.home {
  position: relative;
  z-index: 1;
  overflow: auto;
  height: auto;

  .welcome {
    margin-top: 200px;

    .welcome-text {
      word-wrap: break-word;
      display: block;
      font-family: Ethnocentric;
      font-weight: 1000;
      text-align: center;
      color: #fff;
      font-size: 30px;
      line-height: 30px;
    }

    .brand-name {
      color: #000c;
      font-size: 50px;
      line-height: 50px;
      word-wrap: break-word;
      display: block;
      font-family: Ethnocentric;
      font-weight: 400;
      text-align: center;
      margin-top: 15px;
      background: linear-gradient(to right, #06f8a3 0%, #59e457 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  .brand-logo {
    display: flex;
    justify-content: center;
    margin: 4rem 0;
  }

  .maxWidthLg {
    width: 100%;
    margin-left: auto;
    box-sizing: border-box;
    margin-right: auto;
    display: block;
    padding-left: 16px;
    padding-right: 16px;

    .wrapper {
      background: #000000b3;
      border: 1px solid #59e457;
      border-radius: 5px;
      box-shadow: 0 0 100px 0 #000, 0 0 120px 4px #59e457;
      padding: 1.5rem;
      width: 100%;

      &.about {
        box-shadow: 0 -36px 60px -40px #59e457;
        padding-bottom: 2rem;
      }

      .heading {
        word-wrap: break-word;
        color: #59e457;
        font-family: Ethnocentric;
        font-size: 1.25rem;
        font-weight: 400;
        line-height: 1.25rem;
        text-align: center;
        font-weight: bold;
      }

      .paragraph {
        margin-top: 16px;
        word-wrap: break-word;
        color: #fff;
        font-family: Inter-Regular;
        font-size: 15px;
        font-weight: 400;
      }

      .con {
        margin-top: 16px;
        word-wrap: break-word;
        color: #fff;
        font-family: Inter-Regular;
        font-size: 14px;
        font-weight: 400;
        text-align: left;

        .text {
          margin-bottom: 5px;
          font-family: ProductSans-Regular;
        }

        span {
          color: #59e457;
          font-family: Ethnocentric;
        }
      }
    }

    .content {
      display: flex;
      flex-direction: column;
      margin-top: 96px;
      margin-bottom: 32px;
      -webkit-box-align: center;
      align-items: center;
      border-radius: 9999px;
    }
  }
}

.container {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;

  .card-input {
    background: #000000b3;
    border: 1px solid #59e457;
    border-radius: 5px;
    color: #fff;
    padding: 7px;
    height: 40px;
    // width: 90%;
    overflow: hidden; //超出的文本隐藏
    text-overflow: ellipsis; //溢出用省略号显示
    white-space: nowrap; //溢出不换行
  }

  img {
    margin-left: 16px;
  }
}
.copy{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #fff;
  width: 20%;
}
</style>
